package com.woniuxy.woniuticket.movieinfomodule.controller;

import com.github.pagehelper.PageInfo;
import com.woniuxy.woniuticket.ordermodule.dao.CinemaOderDAO;
import com.woniuxy.woniuticket.movieinfomodule.service.OderService;
import com.woniuxy.woniuticket.movieinfomodule.vo.OderVO;
import com.woniuxy.woniuticket.pojo.CinemaOder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 查询订单信息
 * 卢川
 */
@RestController
@RequestMapping("/oder")
public class ManagerOderController {
    @Autowired
    private OderService oderService;

    @Autowired
    private CinemaOderDAO cinemaOderDAO;
    @RequestMapping("/list")
    public Map queryOder(@RequestParam(value = "page",defaultValue = "1",required = false) Integer currentpage,
                         @RequestParam(value = "limit",defaultValue = "10",required = false) Integer pagesize, OderVO vo){
        List<CinemaOder> list=oderService.queryAllOder(currentpage,pagesize,vo);
        //PageInfo info=new PageInfo(list);
        System.out.println(vo.getScheduleId());
        System.out.println(vo.getMovename());
        System.out.println(vo.getName());
        Map map =new HashMap();
        map.put("code",0);
        map.put("msg","");
        map.put("count",list.size());
        map.put("data",list);
        System.out.println(list);
        return map;
    }


}
